package com.bw.lib_net.interceptor

import android.annotation.SuppressLint
import okhttp3.Interceptor
import okhttp3.Response

/**
 * @author ykj
 * @date 2025-09-16 21:18
 * @description自定义请求头拦截器
 *  */
class HttpHeadInterceptor : Interceptor {

    @SuppressLint("SuspiciousIndentation")
    override fun intercept(chain: Interceptor.Chain): Response {

        val original = chain.request() //获取原始请求


        val requestBuilder = original.newBuilder()
            .addHeader("Content-Language", "")//BuildConfig.I18N_LANG
                     .addHeader("platform", "ANDROID")
                    .addHeader("source", "CLUB_APP")
                     .addHeader("meid", "")//meid ?: ""
                     .addHeader("version", "1.0.0") //BuildConfig.VERSION_NAME
                     .addHeader("phoneModel", android.os.Build.BRAND+"_"+android.os.Build.MODEL)

        val request = requestBuilder.build() //构建新的请求
                return chain.proceed(request)

    }

}